<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>server proxy</title>
</head>
<body>
    <button id="button">server proxy</button>
    <script>
        const button = document.querySelector("#button");
        button.addEventListener('click', function() {
            fetch('http://localhost:3000/getData?userName=FruitJ', {
                method: 'GET',
            })
            .then(res => res.json())
            .then(res => {
                console.log('fd.', res);
            })
            .catch(err => {
                console.log(err);
            });
        }, false);
    </script>
</body>
</html>